Don't accept n_targets == -1. (clipboard_unset): unref the old_data, not
authorMatthias Clasen <mclasen@redhat.com>
Wed, 30 Mar 2005 17:37:42 +0000 (17:37 +0000)
committerMatthias Clasen <matthiasc@src.gnome.org>
Wed, 30 Mar 2005 17:37:42 +0000 (17:37 +0000)
2005-03-30  Matthias Clasen  <mclasen@redhat.com>

* gtk/gtkclipboard.c (gtk_clipboard_set_can_store):
Don't accept n_targets == -1.
(clipboard_unset): unref the old_data, not the
user_data which we have just cleared.  (#172038, Sven
Neumann)

ChangeLog
ChangeLog.pre-2-10
ChangeLog.pre-2-8
gtk/gtkclipboard.c

index 28e86a6267fb979a18b49f83bc233ae660e6bc12..59a7fd004f1ed59c800e72660077f729eb9ac498 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
 2005-03-30  Matthias Clasen  <mclasen@redhat.com>
 
+       * gtk/gtkclipboard.c (gtk_clipboard_set_can_store): 
+       Don't accept n_targets == -1.
+       (clipboard_unset): unref the old_data, not the
+       user_data which we have just cleared.  (#172038, Sven
+       Neumann)
+
        * gtk/gtkcombobox.c (gtk_combo_box_popup): Don't 
        segfault if somebody tries to popup an unrealized
        combo box.  (#172031, Felipe Heidrich)
index 28e86a6267fb979a18b49f83bc233ae660e6bc12..59a7fd004f1ed59c800e72660077f729eb9ac498 100644 (file)
@@ -1,5 +1,11 @@
 2005-03-30  Matthias Clasen  <mclasen@redhat.com>
 
+       * gtk/gtkclipboard.c (gtk_clipboard_set_can_store): 
+       Don't accept n_targets == -1.
+       (clipboard_unset): unref the old_data, not the
+       user_data which we have just cleared.  (#172038, Sven
+       Neumann)
+
        * gtk/gtkcombobox.c (gtk_combo_box_popup): Don't 
        segfault if somebody tries to popup an unrealized
        combo box.  (#172031, Felipe Heidrich)
index 28e86a6267fb979a18b49f83bc233ae660e6bc12..59a7fd004f1ed59c800e72660077f729eb9ac498 100644 (file)
@@ -1,5 +1,11 @@
 2005-03-30  Matthias Clasen  <mclasen@redhat.com>
 
+       * gtk/gtkclipboard.c (gtk_clipboard_set_can_store): 
+       Don't accept n_targets == -1.
+       (clipboard_unset): unref the old_data, not the
+       user_data which we have just cleared.  (#172038, Sven
+       Neumann)
+
        * gtk/gtkcombobox.c (gtk_combo_box_popup): Don't 
        segfault if somebody tries to popup an unrealized
        combo box.  (#172031, Felipe Heidrich)
index bb21b009c7c426e5fe5f7b787eff63d91bb08a94..dde348e1cdf55e65f2337fe956d1514242960dc1 100644 (file)
@@ -678,7 +678,7 @@ clipboard_unset (GtkClipboard *clipboard)
    */
   if (old_have_owner &&
       old_n_storable_targets != -1)
-    g_object_unref (clipboard->user_data);
+    g_object_unref (old_data);
 }
 
 /**
@@ -1609,6 +1609,7 @@ gtk_clipboard_set_can_store (GtkClipboard         *clipboard,
   };
   
   g_return_if_fail (GTK_IS_CLIPBOARD (clipboard));
+  g_return_if_fail (n_targets >= 0);
 
   if (clipboard->selection != GDK_SELECTION_CLIPBOARD)
     return;